<html>
<head>
    <script  src="https://lib.baomitu.com/socket.io/2.3.0/socket.io.js"></script>
    <script>
      const socket = io('http://localhost:5000');
      socket.on('connect', function() {
        console.log('Connected');

        socket.emit('logs', { test: 'test' });
        socket.emit('identity', 10000000, response =>
          console.log('Identity:', response),
        );
      });
      socket.on('logs', function(data) {
        console.log('event', data);
      });
      socket.on('exception', function(data) {
        console.log('event', data);
      });
      socket.on('disconnect', function() {
        console.log('Disconnected');
      });
      setTimeout(()=>{
        socket.close(()=>{
          console.log('two second after close');
        });
      },2000);

    </script>
</head>

<body></body>
</html>
